﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;

namespace AppHelper
{
    public class MailServis
    {
        public static void MailGonder(string Kimden, string Kime, string Konu, string Icerik)
        {
            MailAddress Gonderen = new MailAddress(Kimden);
            MailAddress Alici = new MailAddress(Kime);
            MailMessage email = new MailMessage(Gonderen, Alici);

            email.IsBodyHtml = true;
            email.Subject = Konu;
            email.Body = Icerik;
            email.Priority = MailPriority.High;
            NetworkCredential auth = new NetworkCredential("info@mysanart.com", "my1sanart");
            SmtpClient smtp = new SmtpClient();
            smtp.EnableSsl = true;
            smtp.Host = "smtp.mysanart.com";
            smtp.Port = 587;
            smtp.UseDefaultCredentials = false;
            smtp.Credentials = auth;
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            smtp.Send(email);
        }
    }
}
